import SvgIcon from './SvgIcon.vue'

const requireAll = requireContext => requireContext.keys().map(requireContext)

export default {
  install(app) {
    app.component('svg-icon', SvgIcon)
    const req = require.context('./svg', false, /\.svg$/)
    const businessReq = require.context('../views/business-component/svg', false, /\.svg$/) // 业务组件svg

    const znzcQeq = require.context('./svg/znzc', false, /\.svg$/) // 智能侦测svg
    const eventReq = require.context('./svg/event', false, /\.svg$/) // 智能侦测svg

    requireAll(req)
    requireAll(businessReq);
    requireAll(znzcQeq)
    requireAll(eventReq)
  }
}
